Optimal. Leaf size=61 \[ -\frac {2 b^2 \tanh ^{-1}\left (\frac {a+b \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{a^2 \sqrt {a^2-b^2}}-\frac {b x}{a^2}-\frac {\cos (x)}{a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11, antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.546, Rules used = {3853, 12, 3783, 2660, 618, 206} \[ -\frac {2 b^2 \tanh ^{-1}\left (\frac {a+b \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{a^2 \sqrt {a^2-b^2}}-\frac {b x}{a^2}-\frac {\cos (x)}{a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 206
Rule 618
Rule 2660
Rule 3783
Rule 3853
Rubi steps
\begin {align*} \int \frac {\sin (x)}{a+b \csc (x)} \, dx &=-\frac {\cos (x)}{a}-\frac {\int \frac {b}{a+b \csc (x)} \, dx}{a}\\ &=-\frac {\cos (x)}{a}-\frac {b \int \frac {1}{a+b \csc (x)} \, dx}{a}\\ &=-\frac {b x}{a^2}-\frac {\cos (x)}{a}+\frac {b \int \frac {1}{1+\frac {a \sin (x)}{b}} \, dx}{a^2}\\ &=-\frac {b x}{a^2}-\frac {\cos (x)}{a}+\frac {(2 b) \operatorname {Subst}\left (\int \frac {1}{1+\frac {2 a x}{b}+x^2} \, dx,x,\tan \left (\frac {x}{2}\right )\right )}{a^2}\\ &=-\frac {b x}{a^2}-\frac {\cos (x)}{a}-\frac {(4 b) \operatorname {Subst}\left (\int \frac {1}{-4 \left (1-\frac {a^2}{b^2}\right )-x^2} \, dx,x,\frac {2 a}{b}+2 \tan \left (\frac {x}{2}\right )\right )}{a^2}\\ &=-\frac {b x}{a^2}-\frac {2 b^2 \tanh ^{-1}\left (\frac {b \left (\frac {a}{b}+\tan \left (\frac {x}{2}\right )\right )}{\sqrt {a^2-b^2}}\right )}{a^2 \sqrt {a^2-b^2}}-\frac {\cos (x)}{a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.10, size = 56, normalized size = 0.92 \[ -\frac {-\frac {2 b^2 \tan ^{-1}\left (\frac {a+b \tan \left (\frac {x}{2}\right )}{\sqrt {b^2-a^2}}\right )}{\sqrt {b^2-a^2}}+a \cos (x)+b x}{a^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.49, size = 235, normalized size = 3.85 \[ \left [\frac {\sqrt {a^{2} - b^{2}} b^{2} \log \left (-\frac {{\left (a^{2} - 2 \, b^{2}\right )} \cos \relax (x)^{2} + 2 \, a b \sin \relax (x) + a^{2} + b^{2} - 2 \, {\left (b \cos \relax (x) \sin \relax (x) + a \cos \relax (x)\right )} \sqrt {a^{2} - b^{2}}}{a^{2} \cos \relax (x)^{2} - 2 \, a b \sin \relax (x) - a^{2} - b^{2}}\right ) - 2 \, {\left (a^{2} b - b^{3}\right )} x - 2 \, {\left (a^{3} - a b^{2}\right )} \cos \relax (x)}{2 \, {\left (a^{4} - a^{2} b^{2}\right )}}, -\frac {\sqrt {-a^{2} + b^{2}} b^{2} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \sin \relax (x) + a\right )}}{{\left (a^{2} - b^{2}\right )} \cos \relax (x)}\right ) + {\left (a^{2} b - b^{3}\right )} x + {\left (a^{3} - a b^{2}\right )} \cos \relax (x)}{a^{4} - a^{2} b^{2}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.52, size = 77, normalized size = 1.26 \[ \frac {2 \, {\left (\pi \left \lfloor \frac {x}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\relax (b) + \arctan \left (\frac {b \tan \left (\frac {1}{2} \, x\right ) + a}{\sqrt {-a^{2} + b^{2}}}\right )\right )} b^{2}}{\sqrt {-a^{2} + b^{2}} a^{2}} - \frac {b x}{a^{2}} - \frac {2}{{\left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right )} a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.46, size = 72, normalized size = 1.18 \[ \frac {2 b^{2} \arctan \left (\frac {2 \tan \left (\frac {x}{2}\right ) b +2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{a^{2} \sqrt {-a^{2}+b^{2}}}-\frac {2}{a \left (\tan ^{2}\left (\frac {x}{2}\right )+1\right )}-\frac {2 b \arctan \left (\tan \left (\frac {x}{2}\right )\right )}{a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.65, size = 766, normalized size = 12.56 \[ -\frac {2}{a\,\left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2+1\right )}-\frac {b\,x}{a^2}-\frac {b^2\,\mathrm {atan}\left (\frac {\frac {b^2\,\sqrt {a^2-b^2}\,\left (\frac {32\,b^4}{a}-\frac {32\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (2\,a\,b^5-2\,a^3\,b^3\right )}{a^3}+\frac {b^2\,\sqrt {a^2-b^2}\,\left (32\,a^2\,b^2+64\,a\,b^3\,\mathrm {tan}\left (\frac {x}{2}\right )+\frac {b^2\,\sqrt {a^2-b^2}\,\left (32\,a^3\,b^2+\frac {32\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (3\,a^7\,b-2\,a^5\,b^3\right )}{a^3}\right )}{a^4-a^2\,b^2}\right )}{a^4-a^2\,b^2}\right )\,1{}\mathrm {i}}{a^4-a^2\,b^2}-\frac {b^2\,\sqrt {a^2-b^2}\,\left (\frac {32\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (2\,a\,b^5-2\,a^3\,b^3\right )}{a^3}-\frac {32\,b^4}{a}+\frac {b^2\,\sqrt {a^2-b^2}\,\left (32\,a^2\,b^2+64\,a\,b^3\,\mathrm {tan}\left (\frac {x}{2}\right )-\frac {b^2\,\sqrt {a^2-b^2}\,\left (32\,a^3\,b^2+\frac {32\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (3\,a^7\,b-2\,a^5\,b^3\right )}{a^3}\right )}{a^4-a^2\,b^2}\right )}{a^4-a^2\,b^2}\right )\,1{}\mathrm {i}}{a^4-a^2\,b^2}}{\frac {128\,b^5\,\mathrm {tan}\left (\frac {x}{2}\right )}{a^3}+\frac {b^2\,\sqrt {a^2-b^2}\,\left (\frac {32\,b^4}{a}-\frac {32\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (2\,a\,b^5-2\,a^3\,b^3\right )}{a^3}+\frac {b^2\,\sqrt {a^2-b^2}\,\left (32\,a^2\,b^2+64\,a\,b^3\,\mathrm {tan}\left (\frac {x}{2}\right )+\frac {b^2\,\sqrt {a^2-b^2}\,\left (32\,a^3\,b^2+\frac {32\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (3\,a^7\,b-2\,a^5\,b^3\right )}{a^3}\right )}{a^4-a^2\,b^2}\right )}{a^4-a^2\,b^2}\right )}{a^4-a^2\,b^2}+\frac {b^2\,\sqrt {a^2-b^2}\,\left (\frac {32\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (2\,a\,b^5-2\,a^3\,b^3\right )}{a^3}-\frac {32\,b^4}{a}+\frac {b^2\,\sqrt {a^2-b^2}\,\left (32\,a^2\,b^2+64\,a\,b^3\,\mathrm {tan}\left (\frac {x}{2}\right )-\frac {b^2\,\sqrt {a^2-b^2}\,\left (32\,a^3\,b^2+\frac {32\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (3\,a^7\,b-2\,a^5\,b^3\right )}{a^3}\right )}{a^4-a^2\,b^2}\right )}{a^4-a^2\,b^2}\right )}{a^4-a^2\,b^2}}\right )\,\sqrt {a^2-b^2}\,2{}\mathrm {i}}{a^4-a^2\,b^2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sin {\relax (x )}}{a + b \csc {\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________